package com.apes.fa.respository;

import com.apes.fa.model.FaAssetsTransferOut;
import com.apes.fa.model.FaAssetsTransferOutItem;
import com.apes.framework.jpa.repository.CustomRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface FaAssetsTransferOutRepository  extends CustomRepository<FaAssetsTransferOut,String> {

    @Query("SELECT T FROM FaAssetsTransferOut T,FaAssetsTransferOutItem A WHERE T.state = 'create' AND A.assetsTransferOut.id = T.id AND :id = A.faCard.id")
    List<FaAssetsTransferOut> findUseCard(@Param("id") String id);
}
